home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 9 / The PC-SIG Library on CD ROM - Ninth Edition.iso / 401_500 / DISK0465 / DISK0465.ZIP / UPDATE.BAT < prev    next >
DOS Batch File  |  1986-02-08  |  8KB  |  224 lines

  1. echo off
  2. cls
  3. echo .
  4. if not %1x==x goto SYNTAXOK
  5. echo UPDATE requires the database name (DBNAME) of the database
  6. echo being updated to be included on the command line thus:
  7. echo .
  8. echo UPDATE DBNAME(ret)
  9. echo .
  10. echo If the name of the OLD database files is not known then
  11. echo see DIR of old data disk -     DBNAME.DA1 file
  12. echo ........ please wait for system prompt...
  13. goto END
  14. :SYNTAXOK
  15. echo Checking disk for presence of all needed files
  16. if not exist QUERY.COM goto MQ
  17. if not exist FT.EXE goto MF
  18. if not exist FTCOLOR.DAT goto MF
  19. if not exist PRINT.CTR goto MF
  20. if not exist FGRSH.INS goto MF
  21. if not exist NAMES.DA1 goto MF
  22. if not exist NAMES.NTS goto MF
  23. if not exist FTINSTAL.EXE goto MF
  24. if not exist FTINSTAL.DAT goto MF
  25. VERIFY ON
  26. cls
  27. echo . 
  28. echo **********************************************************
  29. echo *  This program will automatically go through all the    *
  30. echo *  steps to create a database using ver 1.15 and will    *
  31. echo *  transfer the OLD data from an earlier FAMILY TIES     *
  32. echo *  version to the new database.                          *
  33. echo *  NOTE: if using v1.09 or earlier you must use the file *
  34. echo *  FT110FIX.EXE supplied with v1.10 before using UPDATE. *  
  35. echo **********************************************************
  36. echo .
  37. echo *  Type of data disk storage
  38. echo *
  39. echo *  F   Floppy disks
  40. echo *  H   Hard disk
  41. query *  Enter type of disk:  F or H @HF
  42. if errorlevel 2 goto FLOPPY
  43. echo Reading file, please wait ...
  44. goto HARD
  45. :FLOPPY
  46. cls
  47. echo **********************************************************
  48. echo *  FLOPPY DISK install:                                  *
  49. echo *  before continuing with this program you must have:    *
  50. echo *     One blank formatted disk with DOS - labeled as     *
  51. echo *       PROGRAM DISK (1.15)  [format with FORMAT B:/S]   *
  52. echo *     One blank formatted disk without DOS - labeled as  *
  53. echo *       DATA DISK (1.15)     [format with FORMAT B:]     *
  54. echo *     The FAMILY TIES v1.15 master (or copy) in drive A: *
  55. echo *     The OLD program & data disks with write protect    *
  56. echo *       tabs on each for safety.                         *
  57. echo **********************************************************
  58. query Do you wish to proceed  Y/N @YN
  59. if errorlevel 2 goto END
  60. echo Place the blank disk with DOS in drive B: (PROGRAM DISK 1.15)
  61. pause
  62. echo Copying program files to the PROGRAM disk
  63. COPY FT.EXE B:
  64. COPY FTCOLOR.DAT B:
  65. COPY FGRSH.INS B:
  66. COPY PRINT.CTR B:
  67. COPY NAMES.DA1 B:
  68. COPY NAMES.NTS B:
  69. COPY FTINSTAL.EXE B:
  70. COPY FTINSTAL.DAT B:
  71. COPY QUERY.COM B:
  72. COPY UPDATE.BAT B:
  73. echo .
  74. echo NOW:
  75. echo 1. Remove the MASTER (copy) from A:
  76. echo 2. Move the PROGRAM DISK 1.15 from B: to A:
  77. echo 3. Place the blank formatted disk without DOS in B: (DATA DISK 1.15)
  78. pause
  79. :VER
  80. if not exist README goto INST
  81. echo .
  82. echo WARNING!!!!  The disk in A: appears to be a MASTER
  83. echo Please check and insert the correct disk
  84. echo .
  85. echo C  Continue the disc is correct
  86. echo D  Disk has been changed - continue
  87. query Enter C or D @CD
  88. if errorlevel 2 goto VER
  89. :INST
  90. COPY QUERY.COM B:
  91. COPY UPDATE.BAT B:
  92. cls
  93. echo .
  94. echo The FTINSTAL program will now be run.  Please choose option A to
  95. echo create a new database and when asked for a NAME for the database
  96. echo you must use the same one as used when the old data was created.
  97. echo This should be    %1
  98. echo NOTE: The files PRINT.CTR, FGRSH.INS & FTCOLOR.DAT are located on A:
  99. echo You will also be asked to enter you own name as Preparer.
  100. query Do you wish continue Y/N @YN
  101. if errorlevel 2 goto END
  102. FTINSTAL
  103. ECHO OFF
  104. query Did the message 'THESE DISKS ARE NOW READY FOR USE' appear  Y/N @NY
  105. if errorlevel 2 goto CPY
  106. echo .
  107. echo The install was not sucessful - reformat the disks and start over!!!
  108. goto END
  109. :CPY
  110. cls
  111. echo .
  112. echo Remove the NEW DATA 1.15 disk from B:
  113. echo Place the OLD program disk in B:
  114. pause
  115. echo .
  116. echo Copying OLD data files from B: to A:
  117. echo (If PC-JR or all files on the data disk then no files will be found)
  118. if not exist %1.DA4 goto PCJR
  119. DEL %1.*
  120. COPY B:%1.*
  121. :PCJR
  122. echo .
  123. echo 1. Remove NEW PROGRAM 1.15 disk from A:
  124. echo 2. Remove OLD program disk from B: and save it in case of error
  125. echo 3. Place the NEW DATA 1.15 disk in A:
  126. echo 4. Place the OLD data disk in B:
  127. pause
  128. echo .
  129. echo Copying the data files . . .
  130. COPY B:%1.*
  131. echo .
  132. echo 1. Remove the OLD data disk from B:
  133. echo 2. Move the NEW DATA 1.15 disk from A: to B:
  134. echo 3. Place the NEW PROGRAM 1.15 disk in A:
  135. pause
  136. echo deleting the UPDATE and QUERY files from the NEW DATA 1.15 disk
  137. DEL B:UPDATE.BAT
  138. DEL B:QUERY.COM
  139. :END1
  140. del QUERY.COM
  141. echo .
  142. echo The 1.15 data base (with old data) is now ready for use
  143. echo Ignore BATCH file missing error (UPDATE.BAT has been deleted)
  144. del UPDATE.BAT
  145. REM end of file - file deleted!!!
  146. :HARD
  147. cls
  148. echo .
  149. echo *******************************************************
  150. echo *   HARD DISK INSTALL                                 *
  151. echo *  Before running UPDATE you should have created a    *
  152. echo *  new subdirectory and made this subdir the default  *
  153. echo *  for the C/D drive. Place the new Program disk in A:*
  154. echo *  enter  A:UPDATE DBNAME(ret)                        *
  155. echo *  Also make a BACKUP copy of the 4 OLD data files.   *
  156. echo *******************************************************
  157. query Do you wish to continue?  Y/N @YN
  158. if errorlevel 2 goto END
  159. query Enter the hard disk letter C or D @CD
  160. if errorlevel 2 goto D2
  161. echo .
  162. C:
  163. echo Copying all files to the HARD DISK
  164. copy a:*.* c:/v
  165. if exist C:%1.DA1 goto WARN
  166. goto HARD1
  167. :D2
  168. echo .
  169. D:
  170. echo Copying all files to the HARD DISK
  171. copy a:*.* d:/v
  172. if not exist D:%1.DA1 goto HARD1
  173. :WARN
  174. echo  WARNING - There are data files for %1 datbase in this sub-dir
  175. echo These files will be erased  -
  176. echo Do you really want to do this?
  177. query N will abort.  Y will cause files to be erased  Y/N @YN
  178. if errorlevel 2 goto END
  179. query Just checking - You really do want to erase the data files Y/N @YN
  180. if errorlevel 2 goto END
  181. DEL %1.*
  182. :HARD1
  183. echo .
  184. echo The FTINSTAL program will now be run.  Please choose option A to
  185. echo create a new database and when asked for a NAME for the database
  186. echo you must use the same one as used when the old data was created.
  187. echo This should be    %1
  188. echo Use the HARD DISK letter for the location of FTCOLOR.DAT, PRINT.CTR, FGRSH.INS
  189. echo You will also be asked to enter you own name as the Preparer.
  190. query Do you wish continue Y/N @YN
  191. if errorlevel 2 goto END
  192. FTINSTAL
  193. query Did the message 'THESE DISKS ARE NOW READY FOR USE' appear?  Y/N @YN
  194. if not errorlevel 2 goto CPYH
  195. echo .
  196. echo The install was not sucessful - del this sub dir and start over!!!
  197. goto END
  198. :CPYH
  199. echo The NEW data files will now be deleted . . .
  200. if exist %1.DA1 goto CPY1
  201. echo WARNING The NEW data files do NOT match the OLD files - %1
  202. echo Unable to continue - UPDATE aborted - wait for prompt . . .
  203. goto END
  204. :CPY1
  205. DEL %1.*
  206. echo .
  207. echo Now use COPY to transfer the OLD data files into this NEW database
  208. echo Erase the subdir containing the old database (if you have back-ups)
  209. goto END1
  210. :MQ
  211. echo .
  212. echo The file   QUERY.COM is missing from this disk please copy from master
  213. goto END
  214. :MF
  215. echo .
  216. echo One of the following files is missing from this disk:
  217. echo .
  218. echo FT.EXE      FTCOLOR.DAT     PRINT.CTR       FGRSH.INS
  219. echo NAMES.DA1   NAMES.NTS       FTINSTAL.EXE    FTINSTAL.DAT
  220. echo .
  221. echo Here is the DIR of this disk:-
  222. DIR/w
  223. :END
  224.